package org.dromara.wms.domain;

import org.dromara.common.tenant.core.TenantEntity;
import com.alibaba.excel.annotation.ExcelProperty;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import jakarta.validation.constraints.*;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;

  import java.io.Serial;

/**
 * 生产计划排程对象 wms_schedule
 *
 * @author wenrui Su
 * @date 2024-05-05
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("wms_schedule")
public class WmsSchedule extends TenantEntity {

@Serial
private static final long serialVersionUID=1L;


  @ExcelProperty(value = "计划id")
  @NotNull(message = "计划id不能为空", groups = { EditGroup.class })
  @TableId(value = "id")
  private Long id;

  @ExcelProperty(value = "订单id")
  private Long orderId;

  @ExcelProperty(value = "计划名称")
  private String name;

  @ExcelProperty(value = "产品id")
  @NotNull(message = "产品id不能为空", groups = { AddGroup.class, EditGroup.class })
  private Long productId;

  @ExcelProperty(value = "交货时间")
  @NotNull(message = "交货时间不能为空", groups = { AddGroup.class, EditGroup.class })
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private Date deliveryTime;

  @ExcelProperty(value = "状态")
  @NotBlank(message = "状态不能为空", groups = { AddGroup.class, EditGroup.class })
  private String status;

  @ExcelProperty(value = "数量")
  @NotNull(message = "数量不能为空", groups = { AddGroup.class, EditGroup.class })
  private Double quantity;

  @ExcelProperty(value = "备注")
  private String remark;

  @TableField(exist = false)
  private Double quantityFinished = 0D;

  @TableField(exist = false)
  private Double quantityInTask = 0D;

  @TableField(exist = false)
  private String productName;

  @TableField(exist = false)
  private String orderName;

  private Long bomId;

  @TableField(exist = false)
  private String bomName;

  @TableField(exist = false)
  private Long costTime;
}
